<template>
  <div class="bulletin">
    <el-form label-width="130px" @submit.native.prevent="Create()">
      <el-form-item label="场馆编号">
        <el-input v-model="venue_id" placeholder="场馆编号" />
      </el-form-item>
      <el-form-item label="日期">
        <el-date-picker v-model="day" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" />
      </el-form-item>
      <el-form-item label="描述">
        <tinymce :height="300" v-model="content" />
      </el-form-item>
      <el-form-item label="PublisherUid">
        <el-input v-model="publisher_uid" placeholder="PublisherUid" />
      </el-form-item>
      <!-- <el-form-item label="发布时间">
        <el-date-picker v-model="created_at" type="datetime" placeholder="选择发布时间" value-format="yyyy-MM-dd HH:mm:ss" />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" native-type="submit">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import SingleImage from '@/components/Upload/SingleImage'
import Tinymce from '@/components/Tinymce'
import { parseTime } from '@/utils/index'
export default {
  components: {
    Tinymce,
    SingleImage
  },
  data() {
    return {
      venue_id: '',
      day: '',
      content: '',
      publisher_uid: '',
      created_at: parseTime(new Date().getTime())
    }
  },
  methods: {
    Create() {
      const params = {
        venue_id: this.venue_id,
        day: this.day,
        content: this.content,
        publisher_uid: this.publisher_uid,
        created_at: this.created_at
      }
      this.$http
        .post('meet_days', params)
        .then(response => {
          this.$success('操作成功')
          this.$router.push('/meet/days-list')
        })
        .catch(response => {
          this.$error(response)
        })
    }
  }
}
</script>

<style>
.bulletin .el-progress-circle {
  background: #fff;
}
.avatar-uploader {
  position: relative;
}
.avatar-uploader .percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  max-width: 500px;
  display: block;
}
</style>
